package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) Login(ctx context.Context, req *system.LoginReq) (res *system.LoginRes, err error) {
	res = new(system.LoginRes)
	res.Token, err = service.SystemLogin().Login(ctx, model.SystemUserLoginInput{
		Username: req.Username,
		Password: req.Password,
	})
	return
}
